The TLookupRequest Structure
You use theTLookupRequest
structure to specify the registered entity name to be looked up by theOTLookupName
function (page 4-25) and to set additional values that the mapper provider uses to circumscribe the search.The
TLookupRequest
structure is defined by theTLookupRequest
data type.
struct TLookupRequest { TNetbuf name; /* name to search for */ TNetbuf addr; /* address bound to named endpoint */ UInt32 maxcnt; /* how many matches are expected */ OTTimeouttimeout; /* how long to continue search */ }; typedef struct TLookupRequest TLookupRequest;Field descriptions
name
- A
TNetbuf
structure specifying the location and size of a buffer that contains the name to be looked up. You must allocate a buffer that contains the name, set thename.buf
field to point to it, and set thename.len
field to the length of the name.addr
- A
TNetbuf
structure describing the address of the node where you expect the names are stored. You should normally supply 0 foraddr.len
. This causes a protocol family like TCP/IP to use the address of the name server selected in the control panel as the destination of its search. For a protocol family like AppleTalk, in which every node has access to name and address information, this parameter is meaningless.- Specifying an address has meaning for those protocols that use a dedicated server or other device to store name information. In such a case, the name specified would override the protocol's default address. To specify an address, you would need to allocate a buffer containing the address, set the
addr.buf
field to point to it, and set theaddr.len
field to the length of the address. Consult the documentation supplied with your protocol to determine whether you can or should specify an address.maxcnt
- A long specifying the number of names you expect to be returned. Some protocols allow the use of wildcard characters in specifying a name. As a result, the
OTLookupName
function might find multiple names matching the specified name pattern. If you expect a specific number of replies for a particular name, you should specify this number to obtain faster execution. There is no default value for this field.timeout
- A long specifying the amount of time, in milliseconds, that should elapse before Open Transport gives up searching for a name. The default value is 0.